<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>上传到商品到抖店</title>
    <script src="https://ajax.aspnetcdn.com/ajax/jquery/jquery-3.5.1.min.js"></script>
    <style>
        * {
            padding: 0;
            margin: 0;
        }

        input {
            outline-style: none;
            border: 0px;

        }

        input {

            font-size: 12px;
            /* 设置输入框中字体的大小 */

            height: 30px;
            /* 设置输入框的高度 */

            border-radius: 4px;
            /* 设置输入框的圆角的大小 */

            border: 1px solid #c8cccf;
            /* 设置输入框边框的粗细和颜色 */


            outline: 0;
            /* 将输入框点击的时候出现的边框去掉 */

            text-align: left;
            /* 设置输入框中文字的位置 */

            padding-left: 10px;

            display: inline-block;
            /* 将输入框设置为块级元素 */

            cursor: pointer;

            /* box-shadow: 2px 2px 5px 1px #ccc; */

        }

        input::-webkit-input-placeholder {
            color: #986655;
            font-size: 12px;
        }

        h1 {
            width: 100%;
            height: 80px;
            line-height: 80px;
            text-align: center;
        }
        body{
            background: url(./banner.jpg) no-repeat ;
            background-size: 100%;
            color: #fff;
        }
        .Box {
            width: 1000px;
            margin: 0 auto;
            /* background-color: #fff; */
            background: rgba(0, 0, 0, 0.72);
            padding: 20px;
            border-radius: 20px;
            border: 3px solid #fff;
        }

        label {
            display: inline-block;
            width: 80px;
        }

        .form-Header {
            width: 100%;
            height: 80px;
            display: flex;
            
        }

        .form-class {
            /* flex: 1; */
            width: 30%;
            justify-content: center;
            align-self: center;
        }

        .class3 {
            margin-left: -50px;
        }

        .specifications {
            width: 100%;
            height: 40px;
            /* display: flex;
            justify-content: center;
            align-self: center; */
        }

        .put-box {
            width: 100%;
            height: 40px;
        }

        .put-box input {
            width: 600px;
        }

        .btn {
            padding: 0;
            width: 80px;
            height: 30px;
            text-align: center;
            line-height: 30px;
            margin: 30px 30px;
            background-color: #FFAE00;
            color: #fff;
        }
        .btn-sub{
            padding-left:250px ;
        }
        .btn:hover {
            color: #FFAE00;
            background-color: #fff;
            transition: 1.5s;
        }
        
    </style>

    <script>

        function upload() {
            var name = $("#name").val();
            var marketPrice = $("#marketPrice").val();
            var discountPrice = $("#discountPrice").val();
            var productFormat = $("#productFormat").val();

            var data = {"name":name, "marketPrice": marketPrice, "discountPrice": discountPrice, "productFormat": productFormat}
            console.log(data)
            $.ajax({
                type: "POST",
                url: "http://127.0.0.1:8080/addGoods",
                data: JSON.stringify(data),
                cache: false,
                contentType: "application/json",
                //processData: false,
                dataType: 'json',
                success: function(result) {
                    alert("success!")
                },
                error: function(error) {
                    alert("fail!")
                }
            });
        }

    </script>
</head>

<body>
    <h1>上传到商品到抖店</h1>
    <div class="Box">

        <form id="test_form">

            <div class="form-Header">
                <div class="form-class1 form-class">
                    <label>&nbsp;&nbsp;分类:</label>
                    <select name="specificationsOne" >
                        <option value="1" selected>服饰内衣</option>
                        <option value="2">童装</option>
                        <!-- selected 表示被选中在页面展示的选项 -->
                    </select>
                </div>
                <div class="form-class2 form-class">
                    <select name="specificationsTwo">
                        <option value="1" selected>女装</option>
                        <option value="2">男装</option>
                        <option value="3">童装</option>
                        <!-- selected 表示被选中在页面展示的选项 -->
                    </select>
                </div>
                <div class="form-class3 form-class">
                    <select name="specificationsThree">
                        <option value="1" selected>女装</option>
                        <option value="2">男装</option>
                        <option value="3">童装</option>
                        <!-- selected 表示被选中在页面展示的选项 -->
                    </select>
                </div>
            </div>

            <div class="specifications">
                <label for="specifications">商品规格:</label>
                <select name="specifications" id="specifications">
                    <option value="xl">XL</option>
                    <option value="xxl">XXL</option>
                    <option value="xxxl" selected>XXXL</option>
                    <!-- selected 表示被选中在页面展示的选项 -->
                </select>
            </div>

            <div class="marketPrice put-box">
                <label>&nbsp;名称:</label>
                <input type="text" name="name" placeholder="请输入名称" id="name">
                <!-- placeholder是透明的提示文字 -->
            </div>
            <div class="marketPrice put-box">
                <label>&nbsp;划线价:</label>
                <input type="text" name="marketPrice" placeholder="请输入划线价" id="marketPrice">
                <!-- placeholder是透明的提示文字 -->
            </div>
            <div class="discountPrice put-box">
                <label>&nbsp;&nbsp;售价:</label>
                <input type="text" name="discountPrice" placeholder="请输入售价" id="discountPrice">
                <!-- placeholder是透明的提示文字 -->
            </div>
            <div class="discountPrice put-box">
                <label>&nbsp;&nbsp;属性:</label>
                <input type="text" name="productFormat" placeholder="请输入属性" id="productFormat">
                <!-- placeholder是透明的提示文字 -->
            </div>

            <!-- 可以提交表单 -->
            <div class="btn-sub " put-box>
                <!-- 可以提交表单 -->
                <input class="btn" onclick="upload()" value="提交">

                <!-- 不可以提交表单 -->
                <input type="reset" class="btn" value="重置">

            </div>


        </form>
    </div>

</body>

</html>